#ifndef GUIOBJECTSCONTAINER_H_
#define GUIOBJECTSCONTAINER_H_

#include "util/LinkedList.h"
#include "gui/objects/GUIObject.h"
#include "gui/objects/GUIObjectFactory.h"

namespace gui {


/* Contenedor de objetos de la interfaz grafica de la aplicacion. */
class GUIObjectsContainer {
public:

	GUIObjectsContainer();

	virtual ~GUIObjectsContainer();

	virtual util::LinkedList<GUIObject> getGUIObjects();


	virtual int getXPos() { return this->getLeftmost() + this->getWidth() / 2; }

	virtual int getYPos() { return this->getTopmost() + this->getHeight() / 2; }

	virtual int getWidth() { return this->rightmost - this->leftmost; }

	virtual int getHeight() { return this->bottommost - this->topmost; }

	virtual int getLeftmost() { return this->leftmost; }

	virtual int getTopmost() { return this->topmost; }

protected:

	virtual void addObjectToContainer(GUIObject* object);

	int leftmost;
	int rightmost;
	int topmost;
	int bottommost;

private:

	virtual void updateLimits(GUIObject* object, bool firstTime);

	util::LinkedList<GUIObject> guiObjects;

};

}

#endif /* GUIOBJECTSCONTAINER_H_ */

